﻿using System.Collections.Generic;

namespace SLNGP.Core.Individuals
{
    public interface IGeneration : IList<IIndividual>
    {
        /// <summary>
        /// Returns a value indicating if an individual with the same genetic makeup exists in the generation.
        /// </summary>
        /// <param name="newIndividual">The individual to be search for.</param>
        /// <returns>true if such an individual exists, false otherwise.</returns>
        bool ContainsIndividualWithSameGenome(IIndividual newIndividual);
        
        /// <summary>
        /// Adds a the individual to generation if an individual with the same genetic makeup doesn't already exist.
        /// </summary>
        /// <param name="NewIndividual">Individual to add to the generation.</param>
        /// <returns>true if the individual was added; false if another individual exists and the individual was not added.</returns>
        bool TryAddUnique(IIndividual NewIndividual);
        
        /// <summary>
        /// Data used by the fitness function. Meant for internal use. 
        /// </summary>
        object FitnessData { get; set; }
    }
}